var daley = 300;
$(function () {
    $('.pop-close, .pop-dialog').click(function (e) {
        closePop();
    });
    // 阻止冒泡事件
    $('.pop-body').click(function (e) {
        e.stopPropagation();
    });

});

window.closeBefore = function () {

};

function openPop(id) {
    $('#' + id + ' > .pop-dialog').fadeIn(daley);
}

function closePop(id) {
    closeBefore();
    if (id === undefined) {
        $('.pop-dialog').fadeOut(daley);
    } else
        $('#' + id + ' > .pop-dialog').fadeOut(daley);
}